<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2014/10/8
 * Time: 14:05
 * smarty封装
 */
require_once(Yii::getPathOfAlias('application.extensions.Smarty').DIRECTORY_SEPARATOR.'Smarty.class.php');
define('SMARTY_VIEW_DIR', Yii::getPathOfAlias('application.views'));

class CSmarty extends Smarty {
    const DIR_SEP = DIRECTORY_SEPARATOR;
    function __construct() {
        parent::__construct();

        $this->template_dir = SMARTY_VIEW_DIR;
        $this->compile_dir = SMARTY_VIEW_DIR.self::DIR_SEP.'template_c';
        $this->caching = false;
        $this->cache_dir = SMARTY_VIEW_DIR.self::DIR_SEP.'cache';
        $this->left_delimiter  =  '<{';
        $this->right_delimiter =  '}>';
        $this->cache_lifetime = 3600;
    }
    function init() {}
}